package net.jjjshop.common.mapper.lbt;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import net.jjjshop.common.entity.lbt.LbLineClass;
import net.jjjshop.common.entity.lbt.LbLineUp;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

/**
 * 公排

 */
@Mapper
public interface LbLineClassMapper extends BaseMapper<LbLineClass> {


    /**
     * 根据用户公排订单信息查询商家
     * @param uid
     * @return
     */
    @Select("SELECT b.name title,b.shop_supplier_id id from lb_line_up a LEFT JOIN jjjshop_supplier b on a.pid = b.shop_supplier_id WHERE b.is_delete=0 and b.`status`=0 and uid =#{uid} GROUP BY a.pid")
    List<LbLineClass> queryList(Integer uid);


    @Select("SELECT *  from lb_line_class WHERE store_id=#{storeId}")
    List<LbLineClass> queryAll(Integer storeId);

    @Select("SELECT a.*,b.name shop_name  from lb_line_class a LEFT JOIN jjjshop_supplier b on a.store_id=b.shop_supplier_id WHERE a.`status` =1")
    List<LbLineClass> useList();
}
